import React ,{Component} from 'react';
import ReactDOM from 'react-dom'
import {Header} from '../Components';
import { PersistGate } from 'redux-persist/lib/integration/react'
 import configureStore  from '../stroe/store'
let { store, persistor } = configureStore()
import {
    HashRouter ,
    Route,
    NavLink,
    Switch
  } from 'react-router-dom';
  import routes from './router-config';
  import {NoMatch} from '../Components';
  import {Provider} from 'react-redux'
 


  import { Button } from 'element-react';
  import 'element-theme-default';

ReactDOM.render( 
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<HashRouter>
    <div>                      
       <Header/> 
       <div className="row">
            <div className="col-md-1">
                <Button type="primary" icon="search">搜索</Button>
            </div>
            <div className="col-md-10">
                <Switch>				
                    {routes.map((route,index)=>{               
                        return  <Route key={index} path={route.path} component={route.component} exact={route.exact}/>
                        }
                            
                    )}                    				
                    <Route  component={NoMatch}/>
                </Switch>
            </div>
            <div className="col-md-1">
            </div>
        </div>      							
  </div>
  </HashRouter>	
  </PersistGate>
  </Provider>
,document.getElementById('app'))
      
 

    
  